'''打印nXn个*'''
# n = int(input('请输入大小'))
# for i in range(n):
#     for j in range(n):
#         print('*',end=' ')
#     print()

# 将以上代码块编成一个函数
def print_triangle():
    n = int(input('请输入大小:'))
    for i in range(n):
        for j in range(n):
            print('*', end=' ')
        print()
# 调用函数
print_triangle()
